Skip to content

fix(llmobs): read the text of Bedrock Converse guardContent blocks - #10173

Merged
BridgeAR merged 1 commit into
DataDog:masterfrom
colecrawford-reify:fix/llmobs-bedrock-converse-guardcontent
Sep 8, 2026
Merged

fix(llmobs): read the text of Bedrock Converse guardContent blocks#10173
BridgeAR merged 1 commit into
DataDog:masterfrom
colecrawford-reify:fix/llmobs-bedrock-converse-guardcontent

Conversation

@colecrawford-reify

Copy link
Copy Markdown
Contributor

What does this PR do?

Reads the text of Bedrock Converse guardContent blocks when building the LLM Observability input for converse and converseStream requests, instead of recording them as [Unsupported content type: guardContent].

Motivation

guardContent is how a Converse caller scopes a Bedrock guardrail to part of a turn, typically the user's question, with retrieved context left unscanned around it. With the current walker the recorded llm span keeps the context and loses the question, which is the one part of the prompt anyone reading the span needs. The block is input-only, so response and stream extraction are unchanged.

Additional Notes

One unit test in bedrockruntime.util.spec.js covers a guarded text block between two plain text blocks. A guarded image block still falls through to the placeholder.

Fixes #10172

A guardContent block scopes a Bedrock guardrail to part of a Converse turn, usually the user question. The LLM Observability walker treated it as an unsupported block and recorded a placeholder, so the llm span kept the surrounding context and lost the question. Read guardContent.text.text like a plain text block. Input-only block, so response and stream extraction are unchanged.

Fixes DataDog#10172

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ebe192168c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@BridgeAR BridgeAR left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for the PR

@datadog-prod-us1-3

Copy link
Copy Markdown

Pipelines

⚠️ Warnings

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 4 Pipeline jobs failed

All Green | all-green

View more details · View in GitHub Actions

Missing required environment variables; have you set 'id-token: write' in your workflow permissions?

CodeQL | Analyze (javascript)

View more details · View in GitHub Actions

Missing required workflow permissions. Ensure 'id-token: write' is set.

Project | package-size-report

View more details · View in GitHub Actions

Missing required workflow permissions. Ensure 'id-token: write' is set.

View all 4 failed jobs.

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: ebe1921 | Docs | View more details | Give us feedback!

@BridgeAR
BridgeAR merged commit c6d201c into DataDog:master Sep 8, 2026
1494 of 1498 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: LLM Observability drops the text of Bedrock Converse guardContent blocks

2 participants